using System;
using System.IO;
using System.Reflection;
using System.Collections.Generic;

using Heaven.Graphics;
using Heaven.Engine.Animation;
using Heaven.Mathematics;
using Heaven.Texturing;


namespace Heaven.Engine
{
    /// <summary>
    /// This is a class of the text technique.
    /// It is required for text rendering
    /// </summary>
    public class WireframeTechnique : Technique
    {
        #region Fields

        // Cache of HLSL sources
        static string hlslcode = null;
        static string hlslcodetopmost = null;

        // Is this wireframe object be 
        // overwrite current content on the frame
        bool topMost = false;

        #endregion

        #region Properties

       
        #endregion

        #region Initialization

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="topMost">Is this wireframe object be 
        /// overwrite current content on the frame</param>
        public WireframeTechnique(bool topMost)
        {
            this.topMost = topMost;

            if (topMost)
            {
                if (hlslcodetopmost == null)
                {
                    using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Heaven.Engine.Resources.Shaders.WireframeTopmost.fx"))
                    {
                        StreamReader reader = new StreamReader(stream);
                        hlslcodetopmost = reader.ReadToEnd();
                    }
                }
                shader = new Shader(hlslcodetopmost);
            }
            else
            {
                if (hlslcode == null)
                {
                    using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Heaven.Engine.Resources.Shaders.Wireframe.fx"))
                    {
                        StreamReader reader = new StreamReader(stream);
                        hlslcode = reader.ReadToEnd();
                    }
                }
                shader = new Shader(hlslcode);
            }
        }

        /// <summary>
        /// Constructor
        /// </summary>
        public WireframeTechnique() : this(false)
        {
        }

        #endregion

        #region Methods


        #endregion
    }
}
